class Solution {
public:
    int diagonalSum(vector<vector<int>>& mat) {
        int n = mat.size(),sum = 0;
        int i = 0;
        for(i = 0; i < n;i++)
       {
           for(j = 0; j < n;j++)
           {
               if(i==j||i+j==n-1)
               sum += a[i][j];
           }
       }
       return sum;
    }
};